
$("#sub").on('click',function(){
	var keyword = $("#keyword").val();
	openPcSearch(keyword);
	openMobileearch(keyword);
});

/**
 * PC搜索引擎
 * @param  {[type]} keyword [description]
 * @return {[type]}         [description]
 */
function openPcSearch(keyword){
	chrome.tabs.create({url: 'https://www.baidu.com/s?ie=utf-8&wd=' + encodeURI(keyword)});
	chrome.tabs.create({url: 'https://www.so.com/s?ie=utf-8&q=' + encodeURI(keyword)});
	chrome.tabs.create({url: 'https://www.sogou.com/web?query=' + encodeURI(keyword)});
}

function openMobileearch(keyword) {
	chrome.tabs.create({url: 'https://m.sm.cn/s?q=' + encodeURI(keyword)});
	chrome.tabs.create({url: 'https://m.baidu.com/s?word=' + encodeURI(keyword)});
	chrome.tabs.create({url: 'https://m.sogou.com/web/searchList.jsp?keyword=' + encodeURI(keyword)});
	chrome.tabs.create({url: 'https://m.so.com/s?q=' + encodeURI(keyword)});
}